package com.vcg;


import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.management.ManagementFactory;

/**
 * Created by wuyu on 2016/5/31.
 */
@EnableAutoConfiguration
@ComponentScan("com.vcg.comment")
@MapperScan("com.vcg.comment.dao")
public class CommentLaunch {

    private static Logger logger = LoggerFactory.getLogger(CommentLaunch.class);

    public static void main(String[] args) throws IOException {

        //pid 方便 用kill关闭
        String name = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
        File pidFile = new File("CommentLaunch.pid");
        FileWriter writer = new FileWriter(pidFile);
        writer.write(name);
        writer.close();
        SpringApplication.run(CommentLaunch.class, args);
    }
}
